package com.plian.system.dao.cqzc.bondsrepayment;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dao.DaoSupport;
import com.plian.system.model.page.Page;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
* 说明：债券偿还
*/
@Component
public class  BondsRepaymentDao {
@Resource(name = "daoSupport")
private DaoSupport dao;

	/**
	* 新增
	* @param pd
	* @throws Exception
	*/
	public void save(PageData pd) throws Exception {
		dao.save("BondsRepaymentMapper.save",pd);
	}

	/**
	* 修改
	* @param pd
	* @throws Exception
	*/
	public void edit(PageData pd) throws Exception {
		dao.update("BondsRepaymentMapper.edit",pd);
	}

	/**
	* * 根据Id获取一条数据
	* @param id
	* @return
	* @throws Exception
	*/
	public PageData findbyid(String id) throws Exception {
		return (PageData) dao.findForObject("BondsRepaymentMapper.findbyid",id);
	}
	/**
	* 根据更新时间查询最新的一条数据
	* @return
	* @throws Exception
	*/
	public List<PageData> listPage(Page page) throws Exception {
		return (List<PageData>) dao.findForList("BondsRepaymentMapper.listPage",page);
	}
	/**
	* 批量删除
	* @return
	* @throws Exception
	*/
	public void del_ids(List<String> ids) throws Exception {
		dao.delete("BondsRepaymentMapper.del_ids",ids);
	}
	/**
	* 修改状态
	* @param pd
	*/
	public void  refer(PageData pd) throws Exception {
		dao.update("BondsRepaymentMapper.refer",pd);
	}
	/**
	* 根据多个id查询
	* @param pd
	*/
	public List<PageData> findByIds(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("BondsRepaymentMapper.findByIds",pd);
	}
	public List<PageData> reportList(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("BondsRepaymentMapper.reportList",pd);
	}
	/**
	 *累计已偿还金额
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	public String RemainingBalance(PageData pd) throws Exception {
		return (String) dao.findForObject("BondsRepaymentMapper.RemainingBalance",pd);
	}
	/**
	 *超短期累计偿还额度
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	public String  shortTermRepay(PageData pd) throws Exception {
		return (String) dao.findForObject("BondsRepaymentMapper.shortTermRepay",pd);
	}
	public List<PageData> reportListPage(Page page) throws Exception {
		return (List<PageData>) dao.findForList("BondsRepaymentMapper.reportListPage",page);
	}
	public List<PageData> reportListPageSix(Page page) throws Exception {
		return (List<PageData>) dao.findForList("BondsRepaymentMapper.reportListPageSix",page);
	}
}